package com.company.cloud.product.modules.api.request;

import java.util.ArrayList;
import java.util.List;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;

import com.company.cloud.common.bean.BaseParam;
import com.company.cloud.common.bean.LoginSimpleUserInfo;

import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;

@Getter
@Setter
public class ProductStockMultipleSkuOpParam  extends BaseParam{

	@ApiModelProperty(value = "库存操作类型【ProductStockBusiTypeEnum】", required = true)
	@NotEmpty(message = "#库存操作类型不能为空")
	private String busiType;

	@ApiModelProperty(value = "库存商品", required = true)
	@NotNull(message = "#库存商品不能为空")
	private List<ProductStockMultipleSkuItem> items;

	@ApiModelProperty(value = "公司编号" ,required = true)
	@NotEmpty(message = "#公司编号不能为空")
	private String companyNo;

	@ApiModelProperty(value = "客户编号")
	private String custNo;
	
	@ApiModelProperty(value = "操作人用户信息",required = true)
	@NotNull(message = "操作人信息不能为空")
	private LoginSimpleUserInfo opUserInfo;
	
	

	public void addItem(ProductStockMultipleSkuItem item) {
		if (this.items == null) {
			this.items = new ArrayList<ProductStockMultipleSkuItem>();
		}
		if (item != null) {
			this.items.add(item);
		}
	}

}
